package com.ncp.servlet.product;

import java.io.IOException;

import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ncp.model.biz.product.ManageFrontProductBiz;
import com.ncp.model.entity.product.ProductSortBean;

public class ManagerShowSortServlet extends HttpServlet {

	
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		this.doPost(request, response);
	}

	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html");
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		ManageFrontProductBiz mbp = new ManageFrontProductBiz();
	    List<ProductSortBean> listparent =  mbp.getProductSort("select * from PRODUCTSORT where isover=1");
	    List<ProductSortBean> listroot =  mbp.getProductSort("select * from PRODUCTSORT where RootProductSortID=0");
	  
		request.setAttribute("listroot", listroot);
		request.setAttribute("listparent", listparent);
		request.getRequestDispatcher("pages/admin/product/ManagerSort.jsp").forward(request,response);
	}

}
